package com.nyist.waitAndNotify;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * 1.
 *
 * @ClassName RunWaitNotify
 * @Description
 * @Author xiaoyang
 * @Date 2023/04/09/11:22
 */
public class RunWaitNotify {
    public static void main(String[] args) throws InterruptedException {
        ConsumerThread consumerThread = new ConsumerThread();
        ConsumerThread consumerThread2 = new ConsumerThread();
        ProducerThread producerThread = new ProducerThread();

        consumerThread.setName("consumer cccc111");
        consumerThread2.setName("consumer cccccccccc222222222");
        producerThread.setName("producer ppppppp111");

        consumerThread.start();
        consumerThread2.start();
        producerThread.start();

        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(2);

        queue.put("producer");

    }
}
